<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>

</head>
<body>
<header>
    <div v-if="!islogin">
        <a href="#">登录</a>|
        <a href="#">注册</a>
    </div>
    <div v-else>
        <b>welcome {{uname}}</b>|<a href="#">注销</a>
    </div>
</header>

<script>
    var vm = new Vue({
        el: 'header',
        data: {
            islogin: false,
            uname: "xiaxiang"
        }
    })
</script>
</body>

</html>